home *** CD-ROM | disk | FTP | other *** search
/ Backpacker 2 (Sweden) / BackPacker 2 (Sweden) (Disc 1).7z / BackPacker 2 (Sweden) (Disc 1).bin / pc / bp_data / misc / phone.dxr / 00027_InitPhoneValueMeter.ls < prev    next >
Encoding:
Text File  |  1997-01-01  |  1.2 KB  |  37 lines

  1. on InitPhoneValueMeter
  2.   global gValueMeterL, gVM_variableL, gCityDB, gTowns, gNotAnswYet
  3.   set gNotAnswYet to 1
  4.   set currency to getAt(getAt(gCityDB, PICDB(getAt(gTowns, 1))), 6)
  5.   set exchangefactor to getAt(getAt(gCityDB, PICDB(getAt(gTowns, 1))), 7)
  6.   set max to 4000.0 / exchangefactor
  7.   set Step to max / 100
  8.   set max to integer(max)
  9.   set gVM_variableL to [currency, 0, 1, max, Step, max / 2]
  10.   set K to getAt(gVM_variableL, 3)
  11.   set VMin to value(K)
  12.   set K to getAt(gVM_variableL, 4)
  13.   set VMax to value(K)
  14.   set K to getAt(gVM_variableL, 5)
  15.   set Step to value(K)
  16.   set VSpan to VMax - VMin
  17.   set MMin to the left of sprite 10 + 11.0
  18.   set MMax to the right of sprite 10 - 13.0
  19.   set MSpan to MMax - MMin
  20.   set VList to []
  21.   set value to VMin - Step
  22.   repeat while value < VMax
  23.     set value to value + Step
  24.     append(VList, integer(value))
  25.   end repeat
  26.   set pixperpos to MSpan / count(VList)
  27.   set gValueMeterL to []
  28.   set K to count(VList)
  29.   repeat with n = 1 to K
  30.     set p to integer(0.48999999999999999 + ((n - 1) * pixperpos))
  31.     repeat with i = p to n * pixperpos
  32.       append(gValueMeterL, getAt(VList, 1))
  33.     end repeat
  34.     deleteAt(VList, 1)
  35.   end repeat
  36. end
  37.